#include "excel_table.hpp"
#include <gflags/gflags.h>

DEFINE_bool(mode, false, "运行模式： true-发布模式； false-测试模式");
DEFINE_string(file, "", "发布模式日志更新地址");
DEFINE_int32(level, 1, "默认日志等级");

DEFINE_int32(excel_cols, 3, "excel表的列数");
DEFINE_int32(excel_rows, 8, "excel表的行数");
DEFINE_string(file_name, "test.xlsx", "excel表的名字");
DEFINE_string(file_path, "./", "excel表的路径");
DEFINE_string(sheet_name, "Sheet1", "excel表的表页");

int main(int argc, char* argv[]) {
    google::ParseCommandLineFlags(&argc, &argv, true);
    init_logger(FLAGS_mode, FLAGS_file, FLAGS_level);
    LOG_DEBUG("开始读取");
    zhiang::ExcelTable table(FLAGS_excel_rows, FLAGS_excel_cols, FLAGS_file_name, FLAGS_file_path, FLAGS_sheet_name);
    LOG_DEBUG("开始去重");
    table.deduplicate_row({"A"});
    LOG_DEBUG("开始保存");
    table.save("update_test.xlsx");
    LOG_DEBUG("保存完毕");
    return 0;
}